package com.example.demo2.mapper;

import com.example.demo2.entity.Target;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
@Repository
//扫描DAO接口到Spring容器中
public interface TargetMapper {


    Target selectByPrimaryKey(Integer courseTargetId);
//插入课程目标
    int Lv_insertTarget(Integer courseTargetId,
                          Integer courseId,
                         String courseTargetShortname,
                          Integer bulumuTarget,
                          String courseTargetContent);

//    根据课程目标ID删除课程目标
    int Lv_deleteTargetById(Integer courseTargetId);
//    显示所有的课程目标
    List<Target> Lv_selectAllTarget();

//根据课程目标ID来更新
    int Lv_updateTarget(Target target);


//    根据课程目标简称模糊搜索
    List<Target> Lv_searchCourseTarget(String courseTargetShortname);
    List<Target> findTargetContentById(Integer courseId);
    List<Target> findTargetContentByName(String courseName);

    //更新各个课程目标的教学环节、评价方式。权值
    int updateTeacheWayById(@Param("courseId") Integer courseId, @Param("courseTargetNum") Integer courseTargetNum, @Param("teacheWay") String teacheWay, @Param("evaluationWay") String evaluationWay, @Param("evaluationValue") String evaluationValue);
    //查询Target表中所有内容
    List<Target> findTargetAllById(@Param("courseId") Integer courseId);
    //查询评价方式
    List<Target> findEvaluationWayById(@Param("courseId") Integer courseId);
    //更新期末考试要点
    int updateExamPointById(@Param("courseId")Integer courseId,@Param("courseTargetNum") Integer courseTargetNum,@Param("examPoint") String examPoint);
    //查询是否需要期末考试
}